package dao.auth.mybatis;

import java.util.List;

import model.auth.Authorities;
import model.auth.Roles;

import org.springframework.stereotype.Repository;

import dao.MyBatisBaseDao;
import dao.auth.RolesAuthoritiesDao;

@Repository("auth.RolesAuthoritiesDao")
public class RolesAuthoritiesDaoImpl extends MyBatisBaseDao implements RolesAuthoritiesDao {

	public List<Authorities> getAuthoritiesByRoleId(Long roleId) {
		List<Authorities> auths = getSqlSessionTemplate().selectList("auth.RolesAuthoritiesMapper.getAuthoritiesByRoleId", roleId);
		return auths;
	}

	public List<Roles> getRolesByAuthId(Long authId) {
		List<Roles> roles = getSqlSessionTemplate().selectList("auth.RolesAuthoritiesMapper.getRolesByAuthId", authId);
		return roles;
	}

}
